<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");

// show header
echo headerPage("POS Service");
?>
<SCRIPT src="js/js_cust_service.js"></SCRIPT> 
<script>
$(function() {
 
	$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		//$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		//$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<FORM name="Act" id="Act" action="pos.php"  method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 
<INPUT type=hidden value="<?php echo $_POST['custid']?>" id="custid" name="custid"> 
<INPUT type=hidden value="<?php echo $_POST['CustCode']?>" id="CustCode" name="CustCode"> 
<INPUT type=hidden value="<?php echo $_POST['CustName']?>" id="CustName" name="CustName"> 
<INPUT type=hidden value="<?php echo $_SESSION['bid']?>" id="cBranchID" name="cBranchID"> 
  
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
                            <td><a href="javascript:void('0');" id="btnBack">
								<span class="icon_back"></span>Back
								</a>
							</td>
							<td>
								<?php  if ($_SESSION["permission"][$posScreen]["Add"]=="1") {?>
									<a href="javascript:void('0');" id="btnUpdate">
									<span class="icon_update_all"></span>Update All
									</a>
								<?php }?>
							</td>
							 <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/shopping2.png);">
                       POS Service
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
				<fieldset  class="ui-widget ui-widget-content">
				<legend> Customer Information</legend>	
                    <table width="100%" style="line-height:25px;margin-left:0px;">
                        <tr>
                            <td width="25%" class="fontSearch" style="font-weight:bold;">&nbsp;&nbsp;&nbsp;&nbsp;<label for="name">Code : </label><span id="iCode" style="font-weight:normal;"></span></td>
							 <td width="30%" class="fontSearch" style="font-weight:bold;">Name : <span id="iName" style="font-weight:normal;"></span></td>
							 <td width="45%" class="fontSearch" style="font-weight:bold;">Birthday : <span id="iBirthday" style="font-weight:normal;"></span></td>
						</tr>
                        <tr>
                            <td width="20%" colspan="3" class="fontSearch" style="padding-left:20;font-weight:bold;">&nbsp;&nbsp;&nbsp;&nbsp;Address : 
								<span id="iAddress" style="font-weight:normal;"></span>
							</td>
						</tr>						
                         <tr>
                           <td width="20%" class="fontSearch" style="padding-left:20;font-weight:bold;">&nbsp;&nbsp;&nbsp;&nbsp;Telephone : 
							<span id="iTele" style="font-weight:normal;"></span>
						   </td>
						   <td class="fontSearch" style="font-weight:bold;" >Email : 
								<span id="iEmail" style="font-weight:normal;"></span>
							</td>
							<td class="fontSearch" style="font-weight:bold;" >Lasted Access : 
								<span id="iLastAccess" style="font-weight:normal;"></span>
							</td>
						</tr>				
                    </table>
				</fieldset>
				<p style='height:10px'></p>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="5%" >No.</th>
								<th style="display:none;">ID</th>
								<th style="display:none;">bid.</th>
								<th class="title" width="30%" >Set/Course</th>
								<th  class="title" width="20%"  nowrap="nowrap">Branch Sales</th>
								<th  class="title" width="10%"  nowrap="nowrap">Last used</th>
								<th  class="title" width="10%"  nowrap="nowrap">Expire Date</th>
								<th  class="title" width="10%"  nowrap="nowrap">Total Times</th>
								<th  class="title" width="10%"  nowrap="nowrap">Remain Times</th>
								<th  class="title" width="5%"  nowrap="nowrap">Action</th>
                      </tr>
                    </thead>
                   <tbody>
                   </tbody>
                   <tfoot>
                         <tr>
							<td colspan="10" >
								<div class="boxfooter">
									 <div class="totalpage">Total : <span id="rowCount"></span>&nbsp;&nbsp;rows</div>
								 	<div id="paging_button"> 
								 	</div>
								 </div> 
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
  </tr>
</table>
 </FORM>
 <!-- Update All -->
  <div id="dialog-Update" >
  <br>
  	<table id="tbServiceAllInfo" cellspacing="1" border="0" width="100%"  cellpadding="2"  
		style="background-color:#f9f9f9;font-size:11px;border:1px solid #EAEAEA;margin-top:20px;">
	<thead>
		<tr style="background-color:#EAEAEA;font-weight:bold;height:20px;color:#2c2d2d">
			<th width="0" style="display:none;">ID</th>
			<th class="title" width="80%" >Course Name</th>
			<th  class="title" width="10%"  nowrap="nowrap">Expire Date</th>
			<th  class="title" width="5%"  nowrap="nowrap">Used</th>
			<th  class="title" width="5%"  nowrap="nowrap">Remain</th>

		</tr>
	</thead>
	<tbody style="font-weight:normal;background-color:#EAEAEA;">
	</tbody>	
	</table>
  </div>
  
  <!-- Update One Item-->
 <div id="dialog-form" >
	<table id="tbServiceInfo" cellspacing="1" border="0" width="100%"  cellpadding="2"  
		style="background-color:#f9f9f9;font-size:12px;border:1px solid #EAEAEA;">
	<thead>
		<tr style="background-color:#EAEAEA;font-weight:bold;height:20px;color:#2c2d2d">
			<th width="30%" align='center' class='addBorderBottom'>Course Name</th>
			<th width="20%" align='center' class='addBorderBottom'>Branch Sales</th>
			<th width="15%" align='center' class='addBorderBottom'>Total Times</th>
			<th width="10%" align='center' class='addBorderBottom'>Used </th>
			<th width="10%" align='center' class='addBorderBottom'>Remain</th>
		</tr>
	</thead>
	<tbody style="font-weight:bold;background-color:#f3f3f3">
	</tbody>	
	</table>
	<table  cellpadding="0" cellspacing="0" border="0" width="100%" class="fieldset">
	<tr>
		<td width='10%'><label for="name">Remark </label></td>
		<td width='85%'><input type="text" name="Remark" id="Remark" value="" class="text ui-widget-content ui-corner-all" style='width:90%' /></td>
		<td width='5%'><button id="btnAddTimes" style="font-size:12px">Add</button></td>
	</tr>
	</table>
	<table id="tbServiceHistory" cellspacing="1" border="0" width="100%"  cellpadding="2"  
		style="background-color:#f9f9f9;font-size:12px;border:1px solid #EAEAEA;">
	<thead>
		<tr style="background-color:#d7d7d7;font-weight:bold;height:20px;color:#fff">
			<th width="5%" align='center' class='addBorderBottom'>No.</th>
			<th style='display:none'>id.</th>
			<th width="10%" align='center' class='addBorderBottom'>Date-Time</th>
			<th width="20%" align='center' class='addBorderBottom'>Branch</th>
			<th width="25%" align='center' class='addBorderBottom'>Approved by</th>
			<th width="30%" align='center' class='addBorderBottom'>Remark</th>
			<th width="5%" align='center' class='addBorderBottom'>Amt</th>
			<th width="5%" align='center' class='addBorderBottom'>Del</th>
		</tr>
	</thead>
	<tbody style="font-weight:normal;background-color:#EAEAEA;">
	</tbody>	
	</table>	
	
</div>
<div id="dialog-confirmRemove" title="Confirm deleted?" style="padding-top:20px;">
	<p style="font-size:13px"><span class="ui-icon ui-icon-alert" 
		style="float:left; margin:0 7px 20px 0;"></span>Are you sure to delete this data?</p>
</div>
<div id="dialog-confirm" title="Confirm ?" style="padding-top:20px;">
	<p style="font-size:13px"><span class="ui-icon ui-icon-notice" 
		style="float:left; margin:0 7px 20px 0;"></span>Confirm to uesd Course/Set/Treatment in this Branch?</p>
	<p style='padding-top:10px;font-size:12px;font-weight:bold;padding-bottom:5px'>Approved by&nbsp;: &nbsp;</p>
	<p style='padding-left:20px'><input type='text' id="appby" name='appby' value='' style='color:red;padding:2px;font-size:12px;width:90%' /></p>
</div>
<?php echo footer();?>